global:
    scrape_interval: 30s
scrape_configs:
    - job_name: 'node_exporter'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['node-exporter']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
    

    - job_name: 'mongo_exporter'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['mongo-exporter']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance


    - job_name: 'postgres_exporter'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['postgres-exporter']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance


    ## config for the multiple Redis targets that the exporter will scrape
    - job_name: 'redis_exporter'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['redis-exporter']
      relabel_configs:
      - source_labels: ['__meta_consul_service_id']
        target_label: instance

    - job_name: 'prometheus'
      static_configs:
        - targets: ['localhost:9090']
    - job_name: 'app_servers'
      static_configs:
        - targets: ['{{ monitor_server }}'] 
      metrics_path: /monitor/app-servers
      scheme: https
    - job_name: 'app_times'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/app-times
      scheme: https
    - job_name: 'user_searches'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/user-searches
      scheme: https
    - job_name: 'classifiers'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/classifiers
      scheme: https
    - job_name: 'db_times'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/db-times
      scheme: https
    - job_name: 'errors'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/errors
      scheme: https
    - job_name: 'feed_sizes'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/feed-sizes
      scheme: https
    - job_name: 'feed_counts'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/feed-counts
      scheme: https
    - job_name: 'feeds'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/feeds
      scheme: https
    - job_name: 'load_times'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/load-times
      scheme: https
    - job_name: 'stories'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/stories
      scheme: https
    - job_name: 'task_codes'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/task-codes
      scheme: https
    - job_name: 'task_pipeline'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/task-pipeline
      scheme: https
    - job_name: 'task_servers'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/task-servers
      scheme: https
    - job_name: 'task_times'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/task-times
      scheme: https
    - job_name: 'updates'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/updates
      scheme: https
    - job_name: 'users'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /monitor/users
      scheme: https
    - job_name: 'django'
      static_configs:
        - targets: ['{{ monitor_server }}']
      metrics_path: /metrics
      scheme: https

    #- job_name: 'mongo heap usage'
    #  consul_sd_configs:
    #  - server: 'consul.service.nyc1.consul:8500'
    #    services: ['flask_metrics_mongo']
    #  relabel_configs:
    #  - source_labels: ['__meta_consul_node']
    #    target_label: instance
    #  metrics_path: /mongo-heap-usage
    - job_name: 'mongo objects'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_mongo']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /objects/
    # - job_name: 'mongo repl set lag'
    #   consul_sd_configs:
    #   - server: 'consul.service.nyc1.consul:8500'
    #     services: ['flask_metrics_mongo']
    #   relabel_configs:
    #   - source_labels: ['__meta_consul_node']
    #     target_label: instance
    #   metrics_path: /mongo-replset-lag/
    - job_name: 'mongo size'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_mongo']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /size/
    - job_name: 'mongo ops'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_mongo']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /ops/
    - job_name: 'mongo page faults'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_mongo']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /page-faults/
    - job_name: 'mongo page queues'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_mongo']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /page-queues/

    - job_name: 'redis active connections'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_redis']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /active-connections/
    - job_name: 'redis commands'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_redis']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /commands/
    - job_name: 'redis connects'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_redis']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /connects/
    - job_name: 'redis db size'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_redis']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /size/
    - job_name: 'redis total memory'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_redis']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /memory/
    - job_name: 'redis used memory'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_redis']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /used-memory/

    - job_name: 'elastic search exporter'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['elasticsearch_exporter']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance

    - job_name: 'postgres exporter'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['postgres_exporter']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance

    - job_name: 'haproxy state'
      consul_sd_configs:
      - server: 'consul.service.nyc1.consul:8500'
        services: ['flask_metrics_haproxy']
      relabel_configs:
      - source_labels: ['__meta_consul_node']
        target_label: instance
      metrics_path: /state/
      scrape_interval: 5s
